package edu.xust.web.controller;

import edu.xust.config.*;
import edu.xust.dto.BaseDto;
import edu.xust.dto.MessageEnum;
import edu.xust.entity.User;
import edu.xust.page.PageInfo;
import edu.xust.service.UserService;
import java.util.List;

@Controller("/userController")
public class UserController {
    @Resource
    UserService userService ;


    @RequestMapping("/getUserByPage")
    @ResponseBody
    public BaseDto getAdminsByPage(@RequestBody PageInfo pageInfo) throws Exception {
        List<User> admins = userService.getUserByPage(pageInfo);
        BaseDto baseDto = new BaseDto(MessageEnum.ADDADMINSUCCESS,admins);
        baseDto.setObj(pageInfo);
        return baseDto;
    }

}
